package com.kaifamiao.modern;

import java.time.LocalDate;

public class LocalDateTest3 {

	public static void main(String[] args) {
		
		LocalDate date = LocalDate.of( 2008 , 8 , 8 );
		
		System.out.println( date.getDayOfYear() );
		
		System.out.println( date.getDayOfMonth() );
		
		System.out.println( date.isLeapYear() );
		// 获得从 EPOCH 到 date 所表示的日子间隔的天数
		System.out.println( date.toEpochDay() );
		
		LocalDate localDate = LocalDate.of( 2008 , 8 , 8 );
		System.out.println( date == localDate );
		
		System.out.println( date.isEqual( localDate ) ); // true
		System.out.println( date.equals( localDate ) ); // true
		
		LocalDate today = LocalDate.now();
		System.out.println( date.isBefore( today ) ); // true
		System.out.println( date.isAfter( today ) ); // false
		
		System.out.println( today.isBefore( date ) ); // false
		System.out.println( today.isAfter( date ) ); // true
	}

}
